<?php

namespace app\common\service;


class HostView extends Base 

{
    /**
     * @name: 端口访问量曲线图
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2019-06-04 14:00:16
     */
    function topPort($limit = 12)
    {
        $return = db('HostView')->field('ym, number')->order('id', 'DESC')->limit($limit)->select();

        foreach($return as $k => $v)
        {
            $d_str = substr($v['ym'], -2);
            $return[$k]['ym'] = str_replace($d_str, '/' . $d_str, $v['ym']) ;
        }

        return array_reverse($return, false);
    }
}